<template>
	<view class="home">
		<ty-tab-around :list="tabsList" :list-key="listKey" :active.sync="tabsIndex" @click="changeTabs"
			lineColor='#111111' lineWidth='230'>
		</ty-tab-around>
		<view class="margin-top-40">
			<view class="bg-ff bg-shadow radius-40 flex align-center margin-bottom-40" v-for="(item,index) in list"
				:key="index">
				<view class="coupbg flex align-center flex-direction">
					<view class="text-ff margin-top-10" style="font-size: 72rpx;"> <text class="text-32">￥</text>
						{{item.money}}</view>
					<view class="text-24 text-ff">{{item.name}}</view>
				</view>
				<view class="flex-one margin-lr-20">
					<view class="text-32">满{{item.min_money}}元可用</view>
					<view class="text-24 text-99 margin-top-10">{{item.expire_time_text}}</view>
				</view>
				<view class="lqbtn" v-if="tabsIndex==0" @click="go('/pages/board/index',2)">去使用</view>
				<view class="statbtn" v-if="tabsIndex==1">已使用</view>
				<view class="statbtn" v-if="tabsIndex==2">已失效</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabsList: ['可使用', '已使用', '已失效'],
				tabsIndex: 0,
				// 显示key
				listKey: '',
				list: []
			}
		},
		onReady() {
			this.loadList(1)
		},
		methods: {
			changeTabs(e){
				this.tabsIndex = e.index
				this.loadList(1)
			},
			loadList(first_page) {
				this.rq.getList('coupon/coupon_record_list', {
					status: this.tabsIndex
				}, {
					that: this,
					first_page
				})
			},

		}
	}
</script>

<style>
	.home {
		width: 100%;
		min-height: 100vh;
		background: #fff;
		padding: 0 30rpx;
	}

	.coupbg {
		width: 176rpx;
		height: 164rpx;
		background: #101010;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
	}

	.lqbtn {
		width: 184rpx;
		height: 68rpx;
		background: #101010;
		border-radius: 200rpx 200rpx 200rpx 200rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 68rpx;
		text-align: center;
		margin-right: 20rpx;
	}
	.statbtn{
		width: 124rpx;
		height: 124rpx;
		background: #F3F3F3;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #2D2D2D;
		line-height: 124rpx;
		text-align: center;
		transform: rotate(45deg);
		border-radius: 50%;
		margin-right: 20rpx;
	}
</style>